import http from '../../utils/request/request'

// 如果是企业客户需要传type="company"，默认是个人客户接口
// 1:个人，2:企业
export function getAllInfoByPage(page = 1, size = 10, type = "personal", key = "") {
    return http({
        url: `/order/${type}Customer/${(page - 1) * size}/${size}${key ? `/${key}` : ""}`,
        method: 'get'
    })
}

export function addInfo(data, type = "personal") {
    return http({
        url: `/order/${type}Customer`,
        method: 'post',
        data,
    })
}
export function delInfoById(id, type = "personal") {
    return http({
        url: `/order/${type}Customer${id}`,
        method: 'delete'
    })
}


export function editInfo(data, type = "personal") {
    return http({
        url: `/order/${type}Customer`,
        method: 'put',
        data,
    })
}

